<?php
 define('SENDFILE_ATTACHMENT', 'attachment'); define('SENDFILE_INLINE', 'inline'); class FLEA_Helper_SendFile { function sendFile($serverPath, $filename, $mimeType = 'application/octet-stream') { header("Content-Type: {$mimeType}"); $filename = '"' . htmlspecialchars($filename) . '"'; $filesize = filesize($serverPath); $charset = FLEA::getAppInf('responseCharset'); header("Content-Disposition: attachment; filename={$filename}; charset={$charset}"); header('Pragma: cache'); header('Cache-Control: public, must-revalidate, max-age=0'); header("Content-Length: {$filesize}"); readfile($serverPath); exit; } } 